/** 
 * Project Name:ZhiWeiCateringManagementSystem 
 * File Name:PayOrderRecordServers.java 
 * Package Name:cn.ccit.servers 
 * Date:2016年11月5日下午8:35:36 
 * Copyright (c) 2016, 120026139@qq.com All Rights Reserved. 
 * 
 */

package cn.ccit.servers;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.ccit.DAO.PayOrderRecordDAO;
import cn.ccit.DAOImp.PayOrderRecordDAOimp;
import cn.ccit.entites.record.PayOrderRecord;
import cn.ccit.iservers.IPayOrderRecordItemServers;
import cn.ccit.iservers.IPayOrderRecordServers;

/**
 * ClassName:PayOrderRecordServers <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason: TODO ADD REASON. <br/>
 * Date: 2016年11月5日 下午8:35:36 <br/>
 * 
 * @author Administrator
 * @version
 * @since JDK 1.6
 * @see
 */
public class PayOrderRecordServers implements IPayOrderRecordServers {
	private PayOrderRecordDAO orderRecordDao = null;
	private IPayOrderRecordItemServers PayOrderItemServers = null;

	public PayOrderRecordServers() {
		orderRecordDao = new PayOrderRecordDAOimp();
		PayOrderItemServers = new PayOrderRecordItemServers();
	}

	@Override
	public boolean addPayOrderRecord(PayOrderRecord doRecord) {
		return orderRecordDao.addPayOrderRecord(doRecord);
	}

	@Override
	public boolean removePayOrderRecord(PayOrderRecord doRecord) {
		return orderRecordDao.removePayOrderRecord(doRecord);
	}

	@Override
	public boolean changePayOrderRecordInfo(PayOrderRecord doRecord) {
		return orderRecordDao.changePayOrderRecordInfo(doRecord);
	}

	@Override
	public List<PayOrderRecord> getSomePayOrderRecords(int start, int limit) {
		return orderRecordDao.getSomePayOrderRecords(start, limit);
	}

	@Override
	public Map<String, Object> searchPayOrderRecordByID(int id) {
		Map<String, Object> temp = new HashMap<String, Object>();
		PayOrderRecord payOrder = orderRecordDao.searchPayOrderRecordByID(id);
		temp.put("payOrderRecord", payOrder);
		temp.put("payOrderRecordItem", PayOrderItemServers
				.searchPayOrderRecordItemBySerialsNumber(payOrder
						.getSerialsNumber()));
		return temp;
	}

	@Override
	public List<PayOrderRecord> searchPayOrderRecordByYear(String year) {
		return orderRecordDao.searchPayOrderRecordByYear(year);
	}

	@Override
	public List<PayOrderRecord> searchPayOrderRecordByMonth(String month) {
		return orderRecordDao.searchPayOrderRecordByMonth(month);
	}

	@Override
	public List<PayOrderRecord> searchPayOrderRecordByDate(String date) {
		return orderRecordDao.searchPayOrderRecordByDate(date);
	}

}
